package com.g8.pethospitallearnbackend.entity;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Field;
import java.util.Date;
@Data
@Slf4j
public class CaseReceived {
    private String caseId;

    private String caseTime;

    private String caseDiseases;

    private String petInfo;

    private String caseSymptom;

    private String caseCheck;

    private String caseDiagnosis;

    private String caseMedicine;

    private String caseTreat;

    private String caseSymptomPic;

    private String caseSymptomVideo;

    private String caseCheckPic;

    private String caseCheckVideo;

    private String caseDiagnosisPic;

    private String caseDiagnosisVideo;

    private String caseTreatPic;

    private String caseTreatVideo;

    private String default1;
    private String default2;
    private String default3;

    public Object getPropertyValue(String propertyName) {
        try {
            // 获取对象的 Class
            Class<?> clazz = this.getClass();
            // 根据属性名获取对应的 Field 对象
            Field field = clazz.getDeclaredField(propertyName);
            // 设置私有属性可访问
            field.setAccessible(true);
            // 返回该属性的值
            return field.get(this);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            log.info("没有该字段");
            e.printStackTrace(); // 或者进行适当的异常处理
            return null;
        }
    }
}
